import dayjs from "dayjs";

export const formatDate = (value: string | number | Date):any => {
  const date = dayjs(value);
  return {
    year: date.year(),
    month: date.month() + 1, // 月份从0开始，需要加1
    day: date.date(),
    hour: date.hour(),
    minute: date.minute(),
    second: date.second()
  };
};